import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ActivationVO, ActivationForm, ActivationQuery } from '@/api/llm/code/types';

/**
 * 查询设备激活记录列表
 * @param query
 * @returns {*}
 */

export const listActivation = (query?: ActivationQuery): AxiosPromise<ActivationVO[]> => {
  return request({
    url: '/llm/code/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询设备激活记录详细
 * @param id
 */
export const getActivation = (id: string | number): AxiosPromise<ActivationVO> => {
  return request({
    url: '/llm/code/' + id,
    method: 'get'
  });
};

/**
 * 新增设备激活记录
 * @param data
 */
export const addActivation = (data: ActivationForm) => {
  return request({
    url: '/llm/code',
    method: 'post',
    data: data
  });
};

/**
 * 修改设备激活记录
 * @param data
 */
export const updateActivation = (data: ActivationForm) => {
  return request({
    url: '/llm/code',
    method: 'put',
    data: data
  });
};

/**
 * 删除设备激活记录
 * @param id
 */
export const delActivation = (id: string | number | Array<string | number>) => {
  return request({
    url: '/llm/code/' + id,
    method: 'delete'
  });
};
